package com.fjb.service.auth.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjb.common.enums.auth.PermissionStatus;
import com.fjb.common.plugins.ZTree;
import com.fjb.mapper.auth.SysPermissionMapper;
import com.fjb.mapper.auth.SysRolePermissionMapper;
import com.fjb.pojo.auth.SysPermission;
import com.fjb.service.auth.SysPermissionService;

/**
 * <p>
 * 权限表 服务实现类
 * </p>
 *
 * @author hemiao
 * @since 2019-12-22
 */
@Service
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService {
	
	@Autowired
	private SysRolePermissionMapper sysRolePermissionMapper;
	
	@Override
	public List<ZTree> selectValidRoleIdPermissionList(Integer roleId) {
		List<ZTree> infoList = sysRolePermissionMapper.selectRoleIdPermissionList(roleId, PermissionStatus.STATUS_1.getCode());
		return infoList;
	}

}
